<%@page import="com.wef.demo.entity.domain.SubjectDomain"%>
<%@page import="com.gfa4j.resource.ResourceManagerServer"%>
<%@page import="com.wef.common.util.CommonMessageDomain"%>
<%@page import="com.gfa4j.query.Field"%>
<%@ include file="/pages/common/taglib.jsp"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
		<title></title>
		<%@include file="/styles/css_lib.jsp"%>
		<%@include file="/scripts/widgets/jquery-ui/css_lib.jsp"%>
		<%@include file="/scripts/widgets/jqgrid/css_lib.jsp"%>
		
		<%@include file="/pages/common/js_global.jsp"%>
		<%@include file="/scripts/sdk/js_lib.jsp"%>
		<%@include file="/scripts/config/js_lib.jsp" %>
		<%@include file="/scripts/utils/js_lib.jsp"%>
		<%@include file="/scripts/i18n/js_lib.jsp"%>
		<%@include file="/scripts/format/js_lib.jsp"%>
		<%@include file="/scripts/validate/js_lib.jsp"%>
		<%@include file="/scripts/widgets/jquery-ui/js_lib.jsp"%>
		<%@include file="/scripts/widgets/jqgrid/js_lib.jsp"%>
		<%@include file="/scripts/widgets/page-custom/js_lib.jsp"%>
		<script type="text/javascript" src="./demo_save_grid.js"></script>
		
		<k:jqgrid
			queryObjectName="<%=SubjectDomain.Subject%>"
		 	jsonReader="{id:'subjectId'}"
		 	colModel="[{name:'subjectId',hidden:true},
		 		{actionType:'delete',name:'delete'},
		 		{label:'demo.Subject.subjectCode',name:'subjectCode'},
		 		{label:'demo.Subject.subjectName',name:'subjectName'}]"
			id="tableSubject"
		 	searchFormName="searchFormSubject"
		 	searchBtnId="searchBtnSubject"
		 	clearBtnId="clearBtnSubject"
		 	saveBtnId="saveBtnSubject"
		 	newBtnId="newBtnSubject"
		 	cancelBtnId="cancelBtnSubject"
		 	deleteBtnId="deleteBtnSubject"
		 	editFormName="editFormSubject"
		 	serviceMethodName="saveOrUpdateSubjects"
		 	serviceName="SubjectService"
		 	setQueryInfo="setQueryInfo4Subject"
		 	beforeNew="beforeNew4Subject"
		 	beforeSelectRowFunc="beforeSelectRowFunc4Subject"
		 	/>
		
		<script type="text/javascript">
			//App.pageCustomEnable = true;App.pageId = "jqgrid";
			$(window).ready(function(){
				$('div[accordion=true]').accordion({collapsible : true});
				$('div[tabGroup=true]').tabs();
				$('#pageLoadComplete').attr('isComplete',true);
			});
		</script>
	</head>
<body class="body">
	<div id="divAccordion1" accordion="true">                             
		<h1><a href="#"><%=ResourceManagerServer.getInstance().getMessage(SubjectDomain.SubjectNLS)%>&nbsp;<%=ResourceManagerServer.getInstance().getMessage(CommonMessageDomain.TITLE_SERACH)%></a></h1>
		<div>
			<form id="searchFormSubject" name="searchFormSubject">
				<ul id="searchUlSubject" allowChange="true" class="search_box">
					<li>
						<k:label text="demo.Subject.subjectName"/>
						<k:text property="subjectName" styleClass="text" styleId="searchSubjectName" condition="<%=Field.CONDITION_LIKE_ANYWHERE_IC%>"/>
					</li>
					<li>
						<k:label text="demo.Subject.subjectCode"/>
						<k:text property="subjectCode" styleClass="text" styleId="searchSubjectCode" condition="<%=Field.CONDITION_LIKE_ANYWHERE_IC%>"/>
					</li>
				</ul>
			</form>
		</div>
	</div>
	
	<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
		<ul class="button_box">
			<li>
				<k:button styleId="searchBtnSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_SEARCH%>"/>
			</li>
			<li>
				<k:button styleId="clearBtnSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_CLEAR%>"/>
			</li>
			<li>
				<k:button styleId="newBtnSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_NEW%>"/>
			</li>
			<li>
				<k:button styleId="saveBtnSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_SAVE%>"/>
			</li>
			<li>
				<k:button styleId="cancelBtnSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_CANCEL%>"/>
			</li>
			<li>
				<k:button styleId="deleteBtnSubject" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_DELETE%>"/>
			</li>
		</ul>
	</div>
	
	<div id="divAccordion2" accordion="true">
		<h1><a href="#"><%=ResourceManagerServer.getInstance().getMessage(SubjectDomain.SubjectNLS)%>&nbsp;<%=ResourceManagerServer.getInstance().getMessage(CommonMessageDomain.TITLE_TABLE)%></a></h1>
		<div>
			<table id="tableSubject"></table>
		</div>
	</div>
	
	<div id="divAccordion3" accordion="true">
		<h1><a href="#"><%=ResourceManagerServer.getInstance().getMessage(SubjectDomain.SubjectNLS)%>&nbsp;<%=ResourceManagerServer.getInstance().getMessage(CommonMessageDomain.TITLE_EDIT)%></a></h1>
		<div>
			<form id="editFormSubject" name="editFormSubject">
				<ul id="editUlSubject" allowChange="true" class="edit_box">
					<k:hidden property="subjectId"/>
					<li>
						<k:label text="demo.Subject.subjectCode" allowBlank="false"/>
						<k:text property="subjectCode" styleClass="text" styleId="editSubjectCode" validateRules="{required:true}" formatRules="{toUpperCase:true,trimAll:true}"/>
					</li>
					<li>
						<k:label text="demo.Subject.subjectName" allowBlank="false"/>
						<k:text property="subjectName" styleClass="text" styleId="editSubjectName" validateRules="{required:true}"/>
					</li>
				</ul>
			</form>
		</div>
	</div>
	<div id="pageLoadComplete" isComplete="false" style="display: none;"></div>
</body>
</html>